package com.deli.dubbo.controller;

import com.deli.cache.entity.Employee;
import com.deli.cache.mapper.EmployeeMapper;
import com.deli.cache.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Auther: xudeli
 * @Date: 2018/9/18/018 53
 * @Description:
 */
@RestController
public class EmployeeController {

    @Autowired
    EmployeeService employeeService;

    @GetMapping("select/{id}")
    public Employee selectById(@PathVariable("id") Integer id) {
        System.out.println("into selectById method param id :" + id);
        return employeeService.selectById(id);
    }

    @GetMapping("update")
    public int updateEmpl(Employee employee) {
        return employeeService.updateEmp(employee);
    }
}
